import { create } from "zustand";
const useStore = create((set) => {
  return {
    count: 0,
    increment: () => set((state) => ({ count: state.count + 1 })),
    decrement: () => set((state) => ({ count: state.count - 1 })),
    reset: () => set({ count: 0 }) // 添加reset方法
  };
});
function App() {
  const { count, increment, decrement } = useStore();
  return (
    <div className="App">
      hello zustand!
      <button onClick={increment}>{count}</button>
    </div>
  );
}

export default App;
